package com.aiyige.model.request;

import com.aiyige.base.api.ApiManager;

import okhttp3.ResponseBody;
import retrofit2.Call;

/**
 * Created by xiachao
 */
public class GetCommentsRequest {
    private String goodsId;

    private int pageNum = 0;

    public static  int pageSize = 10;

    private GetCommentsRequest(Builder builder) {
        setGoodsId(builder.goodsId);
        setPageNum(builder.pageNum);
        setPageSize(builder.pageSize);
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public String getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(String goodsId) {
        this.goodsId = goodsId;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public static final class Builder {
        private String goodsId;
        private int pageNum = 0;
        private int pageSize = 10;

        private Builder() {
        }

        public Builder goodsId(String goodsId) {
            this.goodsId = goodsId;
            return this;
        }

        public Builder pageNum(int pageNum) {
            this.pageNum = pageNum;
            return this;
        }

        public Builder pageSize(int pageSize) {
            this.pageSize = pageSize;
            return this;
        }

        public Call<ResponseBody> build() {
            return ApiManager.getService().getComments(goodsId,pageNum,pageSize);
        }
    }
}
